/*************************************************************
 * Title: CustomerResource.java
 * Description: 
 * Author: Huang Shaobin
 * Email: shaobin.software@gmail.com
 * CreateTime: Feb 25, 2013 2:19:26 PM
 * Description:
 ************************************************************/
package snow.biz.selling.web.rest;

import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

import snow.biz.selling.service.ICustomerService;
import snow.core.security.Operator;
import snow.core.security.annotations.Operation;
import snow.core.security.annotations.Resource;
import snow.core.web.rest.ResourceSupport;

/**
 * 客户管理相关的接口
 */
@Path("/selling/customers")
@Resource(uri = "/customers")
public class CustomerResource extends ResourceSupport {

	private ICustomerService customerService;

	@POST
	@Produces(MediaType.APPLICATION_JSON)
	@Operation(name = "创建客户", type = Operator.CREATE)
	public Object addCustomer() {
		return null;
	}

	@DELETE
	@Path("/{id:\\d+}")
	@Resource(uri = "/{id:\\d+}")
	@Produces(MediaType.APPLICATION_JSON)
	@Operation(name = "删除客户", type = Operator.REMOVE)
	public Object delCustomer(@PathParam("id")
	Integer id) {
		return null;
	}

	public ICustomerService getCustomerService() {
		return customerService;
	}

	@GET
	@Produces(MediaType.APPLICATION_JSON)
	@Operation(name = "显示客户列表", type = Operator.SEARCH)
	public Object listCustomers() {
		return null;
	}

	@PUT
	@Path("/{id:\\d+}")
	@Resource(uri = "/{id:\\d+}")
	@Produces(MediaType.APPLICATION_JSON)
	@Operation(name = "修改客户信息", type = Operator.MODIFY)
	public Object modCustomer(@PathParam("id")
	Integer id) {
		return null;
	}

	public void setCustomerService(ICustomerService customerService) {
		this.customerService = customerService;
	}

	@GET
	@Path("/{id:\\d+}")
	@Resource(uri = "/{id:\\d+}")
	@Produces(MediaType.APPLICATION_JSON)
	@Operation(name = "显示客户明细", type = Operator.SEARCH)
	public Object showCustomer(@PathParam("id")
	Integer id) {
		return null;
	}

}
